package com.weilive.api.gate.json.handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weilive.api.gate.json.protocol.CSA_MainView;
import com.weilive.api.gate.json.protocol.CSQ_MainView;
import com.weilive.api.service.MainViewSystem;
import com.weilive.core.protocol.json.JsonRequest;
import com.weilive.core.protocol.json.JsonRequestHandler;
import com.weilive.core.protocol.json.JsonResponse;

@Service
public class CSQ_MainView_JsonHandler extends JsonRequestHandler {

	@Autowired
	private MainViewSystem mainViewSystem;

	public Class<?> getRequestType() {
		return CSQ_MainView.class;
	}

	public Class<?> getResponseType() {
		return CSA_MainView.class;
	}

	public JsonResponse handleRequest(JsonRequest request) throws Exception {

		//CSQ_MainView params = (CSQ_MainView) request.getData();

		CSA_MainView response = mainViewSystem.getMainViewMsg();

		return JsonResponse.create(response);
	}

}
